
import bootstrap from '@formio/bootstrap';
import { coreEnTranslation } from '@formio/core';
import _ from 'lodash';

export default {
  ...(bootstrap?.translations?.en || {}),
  // these keys contain a '-' to strip whitespace in core
  // which is not handled correctly in the renderer, so we redefine them
  ..._.omit(coreEnTranslation, ['maxDate', 'minDate']),
  unsavedRowsError: 'Please save all rows before proceeding.',
  invalidRowsError: 'Please correct invalid rows before proceeding.',
  invalidRowError: 'Invalid row. Please correct it or delete.',
  invalidOption: '{{field}} is an invalid value.',
  invalidDay: '{{field}} is not a valid day.',
  alertMessageWithLabel: '{{label}}: {{message}}',
  alertMessage: '{{message}}',
  complete: 'Submission Complete',
  error: 'Please fix the following errors before submitting.',
  errorListHotkey: 'Press Ctrl + Alt + X to go back to the error list.',
  errorsListNavigationMessage: 'Click to navigate to the field with following error.',
  submitError: 'Please check the form and correct all errors before submitting.',
  maxDate: '{{field}} should not contain date after {{maxDate}}',
  minDate: '{{field}} should not contain date before {{minDate}}',
  stripe: '{{stripe}}',
  next: 'Next',
  previous: 'Previous',
  cancel: 'Cancel',
  submit: 'Submit Form',
  confirmCancel: 'Are you sure you want to cancel?',
  saveDraftInstanceError: 'Cannot save draft because there is no formio instance.',
  saveDraftAuthError: 'Cannot save draft unless a user is authenticated.',
  restoreDraftInstanceError: 'Cannot restore draft because there is no formio instance.',
  saveDraftError: 'Unable to save draft.',
  restoreDraftError: 'Unable to restore draft.',
  time: 'Invalid time',
  cancelButtonAriaLabel: 'Cancel button. Click to reset the form',
  previousButtonAriaLabel:'Previous button. Click to go back to the previous tab',
  nextButtonAriaLabel:'Next button. Click to go to the next tab',
  submitButtonAriaLabel:'Submit Form button. Click to submit the form',
  reCaptchaTokenValidationError: 'ReCAPTCHA: Token validation error',
  reCaptchaTokenNotSpecifiedError: 'ReCAPTCHA: Token is not specified in submission',
  apiKey: 'API Key is not unique: {{key}}',
  apiKeyNotValid: 'API Key is not valid: {{key}}',
  typeRemaining: '{{ remaining }} {{ type }} remaining.',
  typeCount: '{{ count }} {{ type }}',
  requiredDayEmpty: '{{ field }} is required',
  formNotReady: 'Form not ready. Use form.ready promise',
  noFormElement: 'No DOM element for form.',
  notUniqueKey: 'API Key is not unique',
  newFormSchema: 'Form schema is for a newer version, please upgrade your renderer. Some functionality may not work.',
  missingUrl: 'Missing URL argument',
  urlNotAttachedToBtn: 'You should add a URL to this button.',
  loadingProjectSettingsError: 'Could not load project settings',
  sessionStorageSupportError: 'Session storage is not supported in this browser.',
  builderUniqueError: `You cannot add more than one {{componentKeyOrTitle}} component to one page.`,
  pageNotFound: 'Page not found',
  noDragInfoError: 'There is no Drag Info available for either dragged or sibling element',
  addonSupportTypeError:'Addon {{label}} does not support component of type {{type}}',
  setPathError: 'Should not be setting the path of a component.',
  calculatedPathDeprecation: 'component.calculatedPath was deprecated, use component.path instead.',
  unknownTemplate: 'Unknown template: {{name}}',
  unknownComponent: 'Unknown component: {{type}}',
  renderTemplateFunctionDeprecation: `Form.io 'render' template function is deprecated.
    If you need to render template (template A) inside of another template (template B),
    pass pre-compiled template A (use this.renderTemplate('template_A_name') as template context variable for template B`,
  whenReadyDeprecation: 'The whenReady() method has been deprecated. Please use the dataReady property instead.',
  loadResourcesError: 'Unable to load resources for {{componentKey}}',
  noSelectDataConfiguration: 'Select component {{componentKey}} does not have data configuration.',
  indexedDBSupportError: "Your browser doesn't support current version of indexedDB",
  caretPositionSavingError: 'An error occurred while trying to save caret position',
  iteratableRowsError: 'Getter #iteratableRows() is not implemented',
  checkRowDeprecation: 'Deprecation Warning: checkRow method has been replaced with processRow',
  noOAuthBtn: 'You must add the OAuth button to a form for it to function properly',
  noOAuthConfiguration: 'OAuth not configured. You must configure oauth for your project before it will work.',
  oAuthErrorsTitle: 'The Following Error Has Occured',
  noOAuthFormUrl: 'You must attach a Form API url to your form in order to use OAuth buttons.',
  oAuthStateError: 'OAuth state does not match. Please try logging in again.',
  componentInvalidRowValidation: 'Invalid row validation for {{componentKey}}',
  videoPlayerNotFound: 'Video player not found in template.',
  synchronizationFailed: 'Synchronization is failed',
  fileWithDuplicatedNameInProgress: 'File with the same name is already being uploaded',
  fileWithDuplicatedNameLoaded: 'File with the same name is already uploaded',
  nestedForm: 'Nested form',
  noDataProvided: 'No data provided',
  subformSubmissionLoadingError: 'Unable to load subform submission {{submissionId}}:',
  noDelimiterSet: 'In order for thousands separator to work properly, you must set the delimiter to true in the component json',
  noSiteKey:'There is no Site Key specified in settings in form JSON',
  failedToNormalize: 'Failed to normalize value',
  failedToCompareItems: 'Error while comparing items',
  editorFocusError: 'An editor did not initialize properly when trying to focus:',
  quillImageUploadFailed: 'Quill image upload failed',
  noFilesSelected: 'No files selected',
  needConfigurationForQuill: 'The WYSIWYG settings are configured for CKEditor. For this renderer, you will need to use configurations for the Quill Editor. See https://quilljs.com/docs/configuration for more information.',
  waitPdfConverting: 'Converting PDF. Please wait.',
  uploading: 'Uploading',
  pasteBelow: 'Paste below',
  copy: 'Copy',
  move: 'Move',
  edit: 'Edit',
  editJson: 'Edit JSON',
  remove: 'Remove',
  clickToSetValue: 'Click to set value',
  words: 'words',
  characters: 'characters',
  addAnother: 'Add Another',
  wantToClearData: 'Do you want to clear data?',
  yesDelete:'Yes, delete it',
  waitFileProcessing: 'Processing file. Please wait...',
  wrongFileType: 'File is the wrong type; it must be {{ pattern }}',
  fileTooSmall: 'File is too small; it must be at least {{ size }}',
  fileTooBig: 'File is too big; it must be at most {{ size }}',
  noFileService: 'File Service not provided.',
  fileProcessingFailed: 'File processing has been failed.',
  readyForUpload: 'Ready to be uploaded into storage',
  readyForRemovingFromStorage: 'Ready to be removed from storage',
  preparingFileToRemove: 'Preparing file to remove',
  succefullyRemoved: 'Succefully removed',
  succefullyUploaded: 'Succefully uploaded',
  maxSelectItems: 'You may only select up to {{maxCount}} items',
  minSelectItems: 'You must select at least {{minCount}} items',
  clickToSign: 'Click to Sign',
  success: 'Success',
  noResultsFound: 'No results found',
  noChoices: 'No choices to choose from',
  typeToSearch: 'Type to search',
  loading: 'Loading',
};
